package echat.future.cn.echat.my.view;

import android.text.Html;

import java.util.List;

import echat.future.cn.echat.R;
import echat.future.cn.echat.databinding.ActivityNomalQuestionBinding;
import echat.future.cn.echat.my.api.UserApi;
import echat.future.cn.echat.my.bean.QuestionBean;
import echat.future.cn.echat.my.utils.HttpUtilsRequst;
import echat.future.cn.echat.my.weight.Navagation.AdapterNavagation;
import echat.future.cn.echat.my.weight.Navagation.IBaseNavagation;

public class NomalQuestionActivity extends BaseActivity<ActivityNomalQuestionBinding>{
    AdapterNavagation adapterNavagation;
    @Override
    public int layoutId() {
        return R.layout.activity_nomal_question;
    }

    @Override
    public IBaseNavagation navagation() {
        adapterNavagation =  new AdapterNavagation(this).setBack(R.drawable.btn_back).setNavagationBackgroudColor(R.color.color_161823);
        return adapterNavagation;
    }

    @Override
    public void initView() {
        adapterNavagation.setTitle(getIntent().getStringExtra("data"),16,R.color.white);
        bind.title.setText(getIntent().getStringExtra("data"));
        loadData();
    }

    private void loadData(){
        new HttpUtilsRequst<List<QuestionBean>>(this,HttpUtilsRequst.retrofitClient.create(UserApi.class)
        .getnoinfophone(getIntent().getStringExtra("type")))
                .setmOnRequstSuccessListener((HttpUtilsRequst.OnRequstSuccessListener<List<QuestionBean>>) data ->
                        bind.content.setText(Html.fromHtml(data.get(0).getCallproblem_con() == null?"":data.get(0).getCallproblem_con())))
                .start();
    }
}
